//
//  PayOverSuccessViewController.m
//  BeautyPicture
//
//  Created by LiuNa on 16/3/11.
//  Copyright © 2016年 szb. All rights reserved.
//

#import "PayOverSuccessViewController.h"
#import "orderCenterVC.h"

@interface PayOverSuccessViewController ()

@end

@implementation PayOverSuccessViewController

- (void)viewWillAppear:(BOOL)animated{
    self.navigationController.navigationBarHidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated{
    self.navigationController.navigationBarHidden = NO;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.view.subviews[0] removeFromSuperview];
    
    [self createButton];
    [self create];
    // Do any additional setup after loading the view.
}


// 创建 返回按钮
- (void)createButton{
    
    UIButton *buttonBig = [[UIButton alloc] initWithFrame:CGRectMake(20, 25, 50, 50)];
    buttonBig.backgroundColor = [UIColor clearColor];
    [buttonBig addTarget:self action:@selector(button:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:buttonBig];
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 23, 23)];
    [button setBackgroundImage:[UIImage imageNamed:@"返回"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(button:) forControlEvents:UIControlEventTouchUpInside];
    [buttonBig addSubview:button];
    
    
    
    
    UIButton *buttonHomeSave = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - 40, 25, 50, 50)];
    buttonHomeSave.backgroundColor = [UIColor clearColor];
    [buttonHomeSave addTarget:self action:@selector(buttonHome:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:buttonHomeSave];
    
    UIButton *buttonHome = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 23, 23)];
    [buttonHome setBackgroundImage:[UIImage imageNamed:@"homeLeft02"] forState:UIControlStateNormal];
    [buttonHome addTarget:self action:@selector(buttonHome:) forControlEvents:UIControlEventTouchUpInside];
    [buttonHomeSave addSubview:buttonHome];
    
}


- (void)button:(UIButton *)bu{
    [self.navigationController popViewControllerAnimated:YES];
}




- (void)buttonHome:(UIButton *)butto{
    [self.navigationController popToRootViewControllerAnimated:YES];
}


- (void)create{
    UIImageView *bigImage = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 60, 100, 120, 120)];
    [bigImage setImage:[UIImage imageNamed:@"DuiHao"]];
    [self.view addSubview:bigImage];
    
    // 支付完成
    UILabel *laben = [[UILabel alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 80, 230, 160, 30)];
    laben.text = @"支付完成";
    laben.font = [UIFont systemFontOfSize:18];
    laben.textAlignment = 1;
    laben.textColor = [UIColor blackColor];
    [self.view addSubview:laben];
    
    
    // 订单号
    UILabel *num = [[UILabel alloc] initWithFrame:CGRectMake(115, 290, 200, 30)];
    num.textColor = BPGlobaThemeColor;
    num.text = self.dingDan;
    num.font = [UIFont systemFontOfSize:17];
    [self.view addSubview:num];
    
    // 您的 订单号
    UILabel *dingdan = [[UILabel alloc] initWithFrame:CGRectMake(20, 290, 100, 30)];
    dingdan.text = @"您的订单号:";
    dingdan.textColor = [UIColor blackColor];
    dingdan.font = [UIFont systemFontOfSize:17];
    [self.view addSubview:dingdan];
    
    
    UIButton *chaKan = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 150, dingdan.y + 40, 300, 40)];
    [chaKan setImage:[UIImage imageNamed:@"overLook"] forState:UIControlStateNormal];
    [chaKan addTarget:self action:@selector(chaKan) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:chaKan];
    
}


- (void)chaKan{
    NSLog(@"查看");
    orderCenterVC *order = [[orderCenterVC alloc] init];
    [self.navigationController pushViewController:order animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
